﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AssetReply.ascx.vb" Inherits="WebForm_AssetMaintain_Component_AssetReply" %>
<asp:Panel ID="panel1" runat="server" BackColor="#E7FEC2" BorderWidth="1" Width="950px"
    Height="450px" ScrollBars="Auto">
    <asp:ObjectDataSource ID="dbAssetDef" runat="server" SelectMethod="GetAssetType"
        TypeName="AssetManage.BBL.AssetBBL">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="kind" Type="String" />
            <asp:ControlParameter ControlID="hiDBName" DefaultValue="" Name="dbName" PropertyName="Value"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="dbASSET1" runat="server" 
        SelectMethod="GetAssetReturnData" TypeName="AssetManage.BBL.AssetBBL">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlassetdef_id" DefaultValue="0" Name="assetdef_id"
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="txtasset_owner" ConvertEmptyStringToNull="False"
                DefaultValue="" Name="asset_owner" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="txtasset_serialNo" ConvertEmptyStringToNull="False"
                DefaultValue="" Name="asset_SerialNo" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="ddlKind" DefaultValue="" Name="Kind" 
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="hiDBName" ConvertEmptyStringToNull="False" Name="dbName"
                PropertyName="Value" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:HiddenField ID="hiDBName" runat="server" />
    <asp:HiddenField ID="hiEmpty" runat="server" />
    <table border="1">
        <tr>
            <td colspan="8" align="center">
                <asp:Label ID="Label1" runat="server" Text="OA資產回報/取消回報作業" Font-Bold="True" Font-Size="20px"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="right" style="width: 111px">
                資產型態:
            </td>
            <td style="width: 182px">
                <asp:DropDownList ID="ddlassetdef_id" runat="server" DataSourceID="dbAssetDef" DataTextField="name"
                    DataValueField="id" Width="120px">
                </asp:DropDownList>
            </td>
            <td align="right" style="width: 144px">
                資產擁有人:
            </td>
            <td style="width: 204px">
                <asp:TextBox ID="txtasset_owner" runat="server" Width="80px"></asp:TextBox>
            </td>
            <td align="right" style="width: 111px">
                類別</td>
            <td style="width: 182px">
                <asp:DropDownList ID="ddlKind" runat="server" AutoPostBack="True">
                    <asp:ListItem Value="1">1.回報確認</asp:ListItem>
                    <asp:ListItem Value="2">2.取消回報</asp:ListItem>
                </asp:DropDownList>
            </td>    
            <td align="right" style="width: 111px">
                資產編號:
            </td>
            <td style="width: 182px">
                <asp:TextBox ID="txtasset_serialNo" runat="server" Width="80px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="8" align="center">
                <asp:Button ID="btnQuery" runat="server" Text="查詢"></asp:Button>
                <asp:Button ID="btnOK" runat="server" Text="確認" />
                <asp:Button ID="btnCancel" runat="server" Text="關閉" />
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <TServerControl:TGridView ID="gvMain" runat="server" AllowHoverEffect="False" 
                    AllowHoverSelect="False" AutoGenerateColumns="False" DataSourceID="dbASSET1" ShowFooterWhenEmpty="False"
                    ShowHeaderWhenEmpty="True" SkinID="pager" TotalRowCount="0" Width="900px">
                    <EmptyDataTemplate>
                        <asp:Label ID="lblEmpty" runat="server" ForeColor="Red" meta:resourcekey="lblEmpty"></asp:Label>
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField Visible="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server">明細</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="資產型態" DataField="DefName" />
                        <asp:BoundField DataField="asset_serialNo" HeaderText="資產編號" />
                        <asp:BoundField HeaderText="擁有人" DataField="ownerName" />
                        <asp:BoundField HeaderText="使用人" DataField="UseName" />
                        <asp:BoundField HeaderText="回報人" DataField="ReturnBy" />
                        <asp:BoundField HeaderText="回報日期" DataField="ReturnDate" />
                        <asp:BoundField HeaderText="回報截止日" DataField="ReturnDeadLine" />
                        <asp:TemplateField HeaderText="回報/取消回報">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkReply" runat="server"  meta:resourcekey="chkReply" 
                                    Visible="false" />
                                <asp:CheckBox ID="chkCancel" runat="server"  meta:resourcekey="chkCancel" AutoPostBack="True" OnCheckedChanged="chkCancel_CheckedChanged" Visible="false" 
                                    ToolTip='<%# Bind("asset_serialNo") %>' />
                                <asp:Label ID="lblReason" runat="server" Text="原因" Visible="False"></asp:Label>
                                <asp:DropDownList ID="ddlReason" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlReason_SelectedIndexChanged"
                                    ToolTip='<%# Bind("asset_serialNo") %>' Visible="False">
                                    <asp:ListItem></asp:ListItem>
                                    <asp:ListItem Value="1">重新回報</asp:ListItem>
                                    <asp:ListItem Value="2">其他</asp:ListItem>
                                </asp:DropDownList>
                                <asp:Label ID="lblMemo" runat="server" Text="說明" Visible="False"></asp:Label>
                                <asp:TextBox ID="txtMemo" runat="server" Visible="False" Width="80px"></asp:TextBox>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkReplyHead" meta:resourcekey="chkReply" runat="server" 
                                    AutoPostBack="True"  Visible="false" 
                                    oncheckedchanged="chkReplyHead_CheckedChanged"  />
                                <asp:CheckBox ID="chkCancelHead"   meta:resourcekey="chkCancel" runat="server" 
                                    AutoPostBack="True" Visible="false" 
                                    oncheckedchanged="chkCancelHead_CheckedChanged"  />
                            </HeaderTemplate>
                        </asp:TemplateField>
                    </Columns>
                </TServerControl:TGridView>
            </td>
        </tr>
        <tr>
            <td colspan="8" align="center">
            </td>
        </tr>
    </table>
</asp:Panel>
<asp:Button ID="btnDummy" runat="server" SkinID="null" Style="display: none" />
<asp:Button ID="btnOK1" runat="server" SkinID="null" Style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="mpSearch" runat="server" CancelControlID="btnCancel"
    X="30" Y="70" OkControlID="btnOK1" PopupControlID="panel1" PopupDragHandleControlID="panel1"
    TargetControlID="btnDummy" />
